//
//  Bundle+Extension.swift
//  CommonKit
//
//  Created by guohq on 2021/7/7.
//

import UIKit

@objc public extension Bundle{

    @objc static func resource(forClass aClass: AnyClass,resource:String) -> Bundle? {
        let bundle = Bundle(for: aClass)
        guard let url = bundle.url(forResource: resource, withExtension: "bundle") else { return nil }
        return Bundle(url: url)
    }
    
    @objc static func resource(forBundlename name: String) -> Bundle? {
        guard let frameWork = Bundle.main.url(forResource: name, withExtension: "bundle") else { return nil }
        let currentBundle = Bundle(url: frameWork)
        return currentBundle
    }
    
}
